<?php

/**
 * Ads form.
 *
 * @package    ndirou_affaire
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class AdsForm extends BaseAdsForm
{
  public function configure()
  {
  		unset($this['created_at'], $this['updated_at'], $this['adses_list']);
  		
  		/* photo 1 */
  		$this->widgetSchema['image_path1'] = new sfWidgetFormInputFileEditable(array(
        'label'     => 'Photo 1',
        'file_src'  =>  '/uploads/image_path1/' . $this->getObject()->image_path1,
        'is_image'  => true,
        'edit_mode' => !$this->isNew(),
        'delete_label' => 'Supprimer la photo<br class="clear"/>',
        'template'  => '<div>%input%<br />%delete% %delete_label%<br class="clear"/></div>',
	    ));
	    $this->validatorSchema['image_path1_delete'] = new sfValidatorPass();
	    $this->validatorSchema['image_path1'] = new sfValidatorFile(array(
	          'required'   => false,
	          'path'       => sfConfig::get('sf_upload_dir') . '/image_path1',
	          'mime_types' => array('application/x-shockwave-flash','image/jpeg','image/gif','image/png','image/jpg','image/bmp'),
	    ));
	    
	    /* photo 2 */
	    $this->widgetSchema['image_path2'] = new sfWidgetFormInputFileEditable(array(
	        'label'     => 'Photo 2',
	        'file_src'  =>  '/uploads/image_path2/' . $this->getObject()->image_path2,
	        'is_image'  => true,
	        'edit_mode' => !$this->isNew(),
	        'delete_label' => 'Supprimer la photo<br class="clear"/>',
	        'template'  => '<div>%input%<br />%delete% %delete_label%<br class="clear"/></div>',
	    ));
	    $this->validatorSchema['image_path2_delete'] = new sfValidatorPass();
	    $this->validatorSchema['image_path2'] = new sfValidatorFile(array(
	          'required'   => false,
	          'path'       => sfConfig::get('sf_upload_dir') . '/image_path2',
	          'mime_types' => array('application/x-shockwave-flash','image/jpeg','image/gif','image/png','image/jpg','image/bmp'),
	    ));
    
    
    
  }
}
